Remote control or remote access systems use a transmitter and a receiver. An exemplary example is a garage door opener system where a transmitter is contained in a remote control unit and a receiver is connected to a garage door motor. The transmitter and receiver typically include different integrated circuits. When activated, the transmitter sends a serial data stream to the receiver by encoding the data and modulating it onto a radio frequency of infrared carrier.
Data encoding (on the transmitter side) into a pulse width modulated format is usually straight-forward. However, decoding (on the receiver side) can be a more complicated operation. Typically, the demodulated incoming signal must be analyzed by comparing the relative width of the incoming pulses, in order to determine which ones represent a logic 1 and which ones represent a logic 0. In addition, a "preamble" or synchronization sequence may be present. The decoding operation usually requires the measurement of high and low times within the waveform. The unit of time is usually determined by a data clock that is typically an external resistor/capacitor RC oscillator.
One convenient way to perform the decoding operation is to use a general-purpose microcontroller, on which the decoding method is implemented in software. However, in order to perform the operation real-time, the controller usually has to run very fast, or a complex structure of interrupts needs to be established. These are strong disadvantages in products where the controller must be kept small (for cost reasons) and running slow (for low power consumption).
It is accordingly an object of the invention to provide an apparatus having a microcontroller and method to decode a pulse-width modulated serial data stream.
Other objects and advantages of the invention will be apparent to those of ordinary skill in the art having the benefit of the specification and drawings herein.